﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace BroRPG.Helpers
{
    class RandomHelper
    {
        public static readonly Random rnd = new Random();

        public static Vector2 GetRandomVector()
        {
            return Vector2.Transform(Vector2.UnitX, Quaternion.CreateFromYawPitchRoll(0, 0, (float)(rnd.NextDouble() * MathHelper.TwoPi)));
        }

        public static Vector2 GetRandomVector(float a, float b)
        {
            return Vector2.Transform(Vector2.UnitX,
                                     Quaternion.CreateFromYawPitchRoll(0, 0, (float)(GetRandomFloat(a, b) * MathHelper.TwoPi)));
        }

        public static float GetRandomFloat(float from = 0, float to = 1)
        {

            return (float)((rnd.NextDouble() * (to - from)) + from);
        }

        public static Color GetRandomColor()
        {
            byte ColorR = (byte)rnd.Next(0, 255);
            byte ColorG = (byte)rnd.Next(0, 255);
            byte ColorB = (byte)rnd.Next(0, 255);
            return new Color(ColorR, ColorG, ColorB,0);
        }
    }
}
